package pl.edu.agh.lab2.sr.beans;


public class Player implements IPlayer {

	private static final long serialVersionUID = 7410982763247207103L;
	private String nick;

	@Override
	public String getInfo() {
		return "Player nick (info): " + nick;
	}

	@Override
	public String getNick() {
		return nick;
	}

	public Player(String nick) {
		super();
		this.nick = nick;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((nick == null) ? 0 : nick.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Player other = (Player) obj;
		if (nick == null) {
			if (other.nick != null)
				return false;
		} else if (!nick.equals(other.nick))
			return false;
		return true;
	}

}
